// ==UserScript==
// @name           Yahoo Display Team Ranking
// @namespace      http://glenncarr.com/greasemonkey/yahoofantasy
// @include        http://sports.yahoo.com/nfl/stats/byteam*
// @description    Display numbers next to team rankings on Yahoo NFL stat pages
// @author         Glenn Carr (glenn at glenncarr dot com)
// $LastChangedRevision: 349 $
// $LastChangedDate: 2007-11-20 22:02:21 +0000 (Tue, 20 Nov 2007) $
// ==/UserScript==
(function() {

var statTable = document.evaluate("//table/tbody/tr/td[@class='yspdetailttl'][contains(.,'Team')]/../../..", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
if ( statTable.snapshotLength == 0 )
    return;
statTable = statTable.snapshotItem( 0 );
for ( var iRow = 0; iRow < statTable.rows.length; iRow++ )
{
	var row = statTable.rows[ iRow ];
	if ( row.cells[ 0 ].getElementsByTagName( 'a' ).length > 0 )
	{
		row.cells[ 0 ].innerHTML = iRow + ' ' + row.cells[ 0 ].innerHTML;
	}
}

})();